<!--Cell-私有的-->
<template>
  <div class="bg bg2" @click="upClick(item)">
    <text class="font32 text1">{{item.strategyName}}</text>
    <div class="all"></div>
    <LImage class="arrow-image" :src="config.img('strategy_arrowx.png')"></LImage> 


    <!--类型-->
    <div :class="['type', isContract ? 'type-hong' : '']">
      <text :class="['font22', isContract ? 'udRed-t1' : 'main-t1']">{{isContract ? T('合约') : T('币币')}}</text>
    </div>
  </div>
</template>

<script>

//功能
import navigator from "@/_js/navigator"; 
import config from "@/_js/config";

const weexFunction = weex.requireModule("WeexFunction");

import I18N from "@/_i18n/i18n";
var T = I18N.t;

export default {

  props:{
    item: JSON, //策略信息
  },
  
  data() {
    return {
      T:T,
      config:config,

      isContract:false
    };
  },

  mounted(){
    this.isContract = this.item.strategyName.includes('合约');
  },

  methods:{
    /********************************** 点击触发*/
    //策略启动
    upClick(item){

      var param = {'strategyId':item.strategyId, 'strategyName':item.strategyName};
      var strategyName = T(item.strategyName);
      if (this.isContract) { //合约
        navigator.open(strategyName, 'upContract/CUp', param);
      } else {
        navigator.open(strategyName, 'up/SUpPrivate', param);
      }
    },
  }
}
</script>


<style src="@/_css/style.css"></style>
<style scoped>
.bg{
  flex-direction: row;
  align-items: center;
  height: 124px;
  border-radius: 16px;

  padding-left: 50px;
  padding-right: 60px;
}
.arrow-image{
  width: 20px;
  height: 20px;
}
.type{
  position: absolute;
  flex-direction: row;
  align-items: center;
  height: 32px;
  padding-left: 10px;
  padding-right: 10px;
  border-top-right-radius: 16px;
  border-bottom-left-radius: 8px;


  background-color: rgba(22, 119, 254, 0.1);

  top: 0;
  right: 0;
}
.type-hong{
  background-color: rgba(252, 97, 128, 0.1);
}
</style>
